import JscMap from '../basic/jsc.basic';
import MapboxglLayer from '../util/maptalks.mapboxgl.es'

class JscVectorTile {
    constructor(id, options) {
        var vectorTileLayer = new MapboxglLayer(id, options);
        this.layer = vectorTileLayer;
    }

    setOptions(options) {
        this.layer.setOptions(options);
    }

}

JscMap.include({
    createVectorTile: function (id, options) {
        options = Object.assign({
            style: "http://192.168.9.13/mapbox/json/bright-v9-cdn.json"
        }, options);
        return new JscVectorTile(id, {
            glOptions: {
                'style': options.style
            }
        });
    }
});